<?php
namespace BP\DA;
abstract class Cash2019 {
	protected static $_hts;	// Hashtable
	protected static $lockObj;	// Object
	public static function __staticinit() { // static class members
		self::$lockObj = new Object();
	}
	public static function gethts () 
	{
		if ((self::$_hts == NULL))
		{
			self::$_hts = []; //map
		}
		return self::$_hts;
	}
	public static function PutRow ($enName, $pkVal, $row) // [String enName, String pkVal, Row row]
	{
		/* !!! synchronized block not supported !!!: (self::$lockObj) */
		{
			$tempVar = Cash2019::gethts()->get($enName);
			$ht = ( (is_array($tempVar)) ? $tempVar : NULL );
			if (($ht == NULL))
			{
				$ht = []; //map
				Cash2019::gethts()->put($enName, $ht);
			}
			if (($ht->containsKey($pkVal) ==  TRUE ))
			{
				$ht->put($pkVal, $row);
			}
			else
			{
				$ht->put($pkVal, $row);
			}
		}
	}
	public static function UpdateRow ($enName, $pkVal, $row) // [String enName, String pkVal, Row row]
	{
		/* !!! synchronized block not supported !!!: (self::$lockObj) */
		{
			$tempVar = Cash2019::gethts()->get($enName);
			$ht = ( (is_array($tempVar)) ? $tempVar : NULL );
			if (($ht == NULL))
			{
				$ht = []; //map
				Cash2019::gethts()->put($enName, $ht);
			}
			$ht->put($pkVal, $row);
		}
	}
	public static function DeleteRow ($enName, $pkVal) // [String enName, String pkVal]
	{
		/* !!! synchronized block not supported !!!: (self::$lockObj) */
		{
			$tempVar = Cash2019::gethts()->get($enName);
			$ht = ( (is_array($tempVar)) ? $tempVar : NULL );
			if (($ht == NULL))
			{
				$ht = []; //map
				Cash2019::gethts()->put($enName, $ht);
			}
			$ht->remove($pkVal);
		}
	}
	public static function GetRow ($enName, $pkVal) // [String enName, String pkVal]
	{
		/* !!! synchronized block not supported !!!: (self::$lockObj) */
		{
			$tempVar = Cash2019::gethts()->get($enName);
			$ht = ( (is_array($tempVar)) ? $tempVar : NULL );
			if (($ht == NULL))
			{
				return NULL;
			}
			if (($ht->containsKey($pkVal) ==  TRUE ))
			{
				return ( ($ht->get($pkVal) instanceof Row) ? $ht->get($pkVal) : NULL );
			}
			return NULL;
		}
	}
	abstract static function PutEns ($ensName, $ens); // [String ensName, Entities ens]
	public static function GetEns ($ensName, $pkVal) // [String ensName, Object pkVal]
	{
		return NULL;
	}
}
Cash2019::__staticinit(); // initialize static vars for this class on load
?>
